<?php

class Form_AgentForm extends Form_Custom_General {

    public function init() {
        $ag_id = $this->createElement('hidden', 'ag_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($ag_id);

        $ag_name = $this->createElement('text', 'ag_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Please enter name")))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => "Name"));
        $this->addElement($ag_name);

        $ag_mobile = $this->createElement('text', 'ag_mobile')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Please enter mobile no.")))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => "Mobile No"));
        $this->addElement($ag_mobile);

        $ag_address = $this->createElement('textarea', 'ag_address')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Please enter address")))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "cols" => "50", "rows" => "3", "class" => "span6", "placeholder" => "Address"));
        $this->addElement($ag_address);

        $ag_status = $this->createElement('select', 'ag_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Please select status")));
        $this->addElement($ag_status);

        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }

}